package com.twu.shapes;

public class Diamond extends Shape {

    public Diamond(int size) {
        super(0);
        new Diamond(size, "*");
    }

    public Diamond(int size, String middle) {
        super(0);
        int spaceSize = size - 1;
        int length = 1;

        for(int i = 0; i < size - 1; i++) {
            drawHorizontalLine(" ", spaceSize);
            spaceSize--;

            drawHorizontalLine("*", length);
            System.out.println();
            length += 2;
        }

        if(middle.equals("*")) {
            drawHorizontalLine("*", length);
        } else {
            System.out.print(middle);
        }
        System.out.println();

        spaceSize++;
        length -= 2;
        for(int i = size - 1; i > 0; i--) {
            drawHorizontalLine(" ", spaceSize);
            spaceSize++;

            drawHorizontalLine("*", length);
            System.out.println();
            length -= 2;
        }
    }
}
